import req from '../utils/request';
import * as URL from '../constans/api';
// 获取二级页面
export function getSecond(params) {
  return req({
    url: URL.SECOND,
    method: 'get',
    params,
  })
    .then((res) => {
      return res.data;
    })
    .catch((err) => Promise.reject(err.response.data));
}
// 获取三级页面
export function getSubCategory(id) {
  return req({
    url: URL.SUB_CATEGORY,
    method: 'get',
    params: {
      id,
    },
  })
    .then((res) => {
      return res.data;
    })
    .catch((err) => Promise.reject(err.response.data));
}
